package com.zhengshang.api.service.impl;

import java.util.List;

import com.zhengshang.api.domain.AppPayRecord;
import com.zhengshang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhengshang.api.mapper.AppBalanceRecordMapper;
import com.zhengshang.api.domain.AppBalanceRecord;
import com.zhengshang.api.service.IAppBalanceRecordService;

/**
 * 余额变更记录Service业务层处理
 *
 * @author zhengshang
 * @date 2021-03-19
 */
@Service
public class AppBalanceRecordServiceImpl implements IAppBalanceRecordService
{
    @Autowired
    private AppBalanceRecordMapper appBalanceRecordMapper;

    /**
     * 查询余额变更记录
     *
     * @param id 余额变更记录ID
     * @return 余额变更记录
     */
    @Override
    public AppBalanceRecord selectAppBalanceRecordById(Long id)
    {
        return appBalanceRecordMapper.selectAppBalanceRecordById(id);
    }

    /**
     * 查询余额变更记录列表
     *
     * @param appBalanceRecord 余额变更记录
     * @return 余额变更记录
     */
    @Override
    public List<AppBalanceRecord> selectAppBalanceRecordList(AppBalanceRecord appBalanceRecord)
    {
        return appBalanceRecordMapper.selectAppBalanceRecordList(appBalanceRecord);
    }

    /**
     * 新增余额变更记录
     *
     * @param appBalanceRecord 余额变更记录
     * @return 结果
     */
    @Override
    public int insertAppBalanceRecord(AppBalanceRecord appBalanceRecord)
    {
        appBalanceRecord.setCreateTime(DateUtils.getNowDate());
        return appBalanceRecordMapper.insertAppBalanceRecord(appBalanceRecord);
    }

    /**
     * 修改余额变更记录
     *
     * @param appBalanceRecord 余额变更记录
     * @return 结果
     */
    @Override
    public int updateAppBalanceRecord(AppBalanceRecord appBalanceRecord)
    {
        return appBalanceRecordMapper.updateAppBalanceRecord(appBalanceRecord);
    }

    /**
     * 批量删除余额变更记录
     *
     * @param ids 需要删除的余额变更记录ID
     * @return 结果
     */
    @Override
    public int deleteAppBalanceRecordByIds(Long[] ids)
    {
        return appBalanceRecordMapper.deleteAppBalanceRecordByIds(ids);
    }


    /**
     * 删除余额变更记录信息
     *
     * @param id 余额变更记录ID
     * @return 结果
     */
    @Override
    public int deleteAppBalanceRecordById(Long id)
    {
        return appBalanceRecordMapper.deleteAppBalanceRecordById(id);
    }
}